

$(function () {

    $("#login_but").click(function () {

        // 获取数据
        var name = $("#exampleInputEmail1").val();
        var password = $("#exampleInputPassword1").val();


        $.ajax({
            url:"/login",
            type:'post',
            data:{name:name,password:password}
        }).success(function (resp) {
            if (resp.errno == "0"){

                alert(resp.errmsg)
                location.href = '/'
            }else {

                alert(resp.errmsg)
            }

        })
    })
})